package com.itaming.lycheeframework.support.properties;

import org.springframework.context.annotation.PropertySource;
import org.springframework.core.annotation.AliasFor;

import java.lang.annotation.*;

/**
 * 扩展的配置源注解
 * <p>
 * 在默认的配置源注解{@link PropertySource}基础上，增加了额外支持：
 * <blockquote>
 * <li>
 * yaml格式：yml, yaml
 * </li>
 * </blockquote>
 *
 * @author A.Ming
 */
@Documented
@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.TYPE)
@PropertySource(value = {}, factory = ExtendedPropertySourceFactory.class)
public @interface ExtendedPropertySource {

    @AliasFor(annotation = PropertySource.class)
    String[] value();

    @AliasFor(annotation = PropertySource.class)
    String name() default "";

    @AliasFor(annotation = PropertySource.class)
    boolean ignoreResourceNotFound() default false;

    @AliasFor(annotation = PropertySource.class)
    String encoding() default "";

}
